INK

Syntax: INK [#ch,] colour      
    or: INK [#ch,] colour1,colour2 [,pattern]
Location: QL ROM 

This command sets the ink colour used inside the given window channel (default #1). The ink colour can be either a solid colour if the first syntax is used (in chich case colour can be any integer in the range 0..255) or a composite colour made up of the three parameters supplied in the second syntax (colour1 and colour2 must both be in the range 0..7).  Luckily, SMSQ/E allows you to include binary and hexadecimal numbers directly in programs (eg INK $f800) which may make the non-standard QL colours easier to use.

The way in which colours are handled depends upon the operating system.  On most systems, only the Standard QL Colour Drivers are supported.  However, SMSQ/E v2.98+ can be used to access further Extended Colour Drivers by configuring SMSQ/E to start with them loaded, or using the start-up screen on QPC.


STANDARD COLOUR DRIVERS
This applies to standard QL operating systems, or can be set under SMSQ/E v2.98+ with the command DISP_COLOUR 0,800,600 or by altering the configuration of the operating system. There are eight solid colours which have the following values (although only four of these colours are available in MODE 4):

value MODE 8  MODE 4
      colour  colour
0     black   black
1     blue    black (should be avoided)
2     red     red
3     magenta red (should be avoided)
4     green   green
5     cyan    green (should be avoided)
6     yellow  white
7     white   white (should be avoided)

The values in MODE 4 which are marked "should be avoided" can be used on standard QLs, but lead to compatability problems when run under the Enhanced Colour Drivers (see below).

Other integer values in the range 8 to 255 are allowed, but these are generally 'composite' colours and repeats of other values.


EXTENDED COLOUR DRIVERS
The following is a description of the various colour modes available under the Extended Colour Drivers provided by SMSQ/E v2.98+.  These are available once SMSQ/E is configured to use the Extended Colour Drivers.

DISP_COLOUR can be used to switch between the standard and extended colour drivers.

QL Colour Mode
This is selected with the command COLOUR_QL and is the default when a program is executed. For the purposes of INK, PAPER, STRIP etc commands, it provides the same colours as under the Standard QL Colour Mode (provided the standard colour=0 to colour=7 is used), except that MODE 4 programs can actually access all 8 colours not just the standard 4.

However,  the actual colours which represent each of the different values can be amended by changing the palette (see PALETTE_QL). This can be used, for example, to rectify programs which display the wrong colours because they presume INK 3 would always be the same as INK 2.

8 Bit Colour Mode
This is supported on the Aurora motherboard (not yet implemented) and QPC, QXL and the Q40/Q60.  It is selected with COLOUR_PAL and allows colour to be in the range 0...255. This is the PAL value and is hardware independent - refer to Appendix 16 for a full list of the colours available.

The colours which represent each of the 256 values allowed can be amended by changing the palette (see PALETTE_8).

For this mode, the INK parameter should be the PAL value (0-255).  If a stipple is required, the two composite PAL colours will need to be specified explicitly - see below.

Native Colour Mode (8 or 16 bit colour)
This should be supported on all implementations of SMSQ/E v2.98+ and is selected with COLOUR_NATIVE. The range supported by colour and the effects all depend upon the display hardware currently in use.  

As a result, under Aurora, it is similar to COLOUR_PAL in that it only supports 8 bit colours, but the colour is specified by the Native Colour Value instead of the PAL value.  On the QPC, QXL and Q40/Q60, it supports 65536 colours as standard.

The value required for INK, PAPER, STRIP etc. depends upon the hardware in use - look at the tables in Appendix 16 for the appropriate hardware and then the Native Colour Value to use.  It may be easier to use hexadecimal or binary to specify the colour, for example INK $F81F for magenta on QPC/QXL.

24 Bit Colour Mode
This is only supported on QPC (dependent on hardware). It is selected with COLOUR_24 and allows colour to be in the range 0..16777215.

Due the values possible in 24 bit colour mode, it is essential that hexadecimal is used to describe colours.  Colours are defined as a 3 byte value representing a value for red, green and blue respectively.  For example, yellow would be INK $FFFF00.


COMPOSITE COLOURS:
INK colour1,colour2,stipple
this creates a composite colour which is a mixture of the two given colours, and displayed in the given stipple pattern. The values for stipple are:
 
value pattern  
0     dots
1     horizontal stripes
2     vertical stripes
3     checkerboard  (the default)

THOR XVI NOTE:
The THOR XVI allows a total of 16 colours in MODE 12 in the range 0 to 7.5 (stipple will actually fall in the range 0...1023). If you add .5 to the normal colour, this switches on the THOR's intensity bit, meaning that for example, the resultant colour for INK 1.5 is somewhere between black and blue (ie. a very dark blue). You can also add .25 to each colour, which will result in a stipple mixture of colours (details unknown at present).

CROSS-REFERENCE:
PAPER and STRIP also set colours within windows.
RMODE can be used to read the current colour mode.
COLOUR_QL, COLOUR_PAL, COLOUR_NATIVE and COLOUR_24 will also affect the colours produced.
PALETTE_QL and PALETTE_8 can be used to change the palette of colours available.
DISP_COLOUR can be used to switch from Extended Colour Drivers to Standard Colour Drivers.
Also refer to INVERSE.
